﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
#if !NET_40_OR_GREATER
    using System.Linq;
#endif

namespace OpenWaves
{
    public static class EnumerableOfStringExtensions
    {
        public static string JoinStrings(this IEnumerable<string> items, string separator = "")
        {
            Contract.Requires<ArgumentNullException>(items != null);

#if NET_40_OR_GREATER
            return String.Join(separator, items);
#else 
            return String.Join(separator, items.ToArray());
#endif
        }
    }
}